import { http } from "@/uni-sub-base/service/request.js"
import configs from "@/config/config.js"
let moduleName = "Order/"
let serviceName = "Order/"
import { getBaseUrls, getShopUrls } from "@/utils/appUrl.js"

//获取订单列表（全部="",待付款=0,待发货=1,待收货=2）
export function getListByUser(data) {
    return http.post({
        url: getShopUrls().baseUrlShop + moduleName + "getListByUser",
        data,
    })
}
//获取订单列表详情
export function getProductOrderInfoByOrderId(data) {
    return http.post({
        url: getShopUrls().baseUrlShop + moduleName + "getProductOrderInfoByOrderId",
        data,
    })
}

//获取待支付订单
export function getPayOrderId(data, path) {
    return http.post({
        url: getShopUrls().baseUrlShop + moduleName + "getPayOrderId" + path,
        data,
    })
}

//再次购买
export function buyAgain(data) {
    return http.post({
        url: getShopUrls().baseUrlShop + moduleName + "buyAgain",
        data,
    })
}

//获取提交订单信息
export function getProductDataBySubmit(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "getProductDataBySubmit",
        data,
    })
}
//提交订单
export function submitOrderByUserCar(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "submitOrderByUserCar",
        data,
    })
}
//线下支付
export function offlinePay(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "offlinePay",
        data,
    })
}

//对账单列表
export function getAccountList(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "getAccountList",
        data,
    })
}

//对账单详情
export function getAccountModel(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "getAccountModel?id=" + data.id,
        data,
    })
}

//获取订单详情
export function getOrderDetail(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "getOrderDetail?orderId=" + data.orderId,
    })
}

//取消订单
export function orderCancel(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "orderCancel?orderId=" + data.orderId,
        data,
    })
}

//支付订单
export function payOrder(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "payOrder?orderId=" + data.orderId,
        data,
    })
}

//确认订单
export function takeOrder(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "takeOrder?orderId=" + data.orderId,
        data,
    })
}
//订单退货
export function OrderReturnApply(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "OrderReturnApply",
        data,
    })
}

//订单退款
export function OrderRefundApply(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "OrderRefundApply",
        data,
    })
}

//获取用户订单列表
export function getUserOrderList(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "getUserOrderList",
        data,
    })
}

//订单评价
export function OrderComment(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "OrderComment",
        data,
    })
}

//添加备注
export function AddOrEditOrderRemark(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "AddOrEditOrderRemark",
        data,
    })
}
//获取支付信息
export function GetPayOrderId(path) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetPayOrderId" + path,
    })
}
//订单支付分批
export function XianPayNew(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "XianPayNew",
        data,
    })
}
//付款记录
export function GetPayListByOrderId(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetPayListByOrderId",
        data,
    })
}
//云支付提交支付订单(银联支付微信小程序)
export function HelPayOrder(data, path) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "HelPayOrder" + path,
        data,
    })
}

//申请退款
export function OrderRefundApplyExchange(data, path = "") {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "OrderRefundApplyExchange" + path,
        data,
    })
}

//作废退款单
export function CancelRefundApplyOrder(data, path = "") {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "CancelRefundApplyOrder" + path,
        data,
    })
}

//退款单详情
export function GetRefundDetail(data, path = "") {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetRefundDetail" + path,
        data,
    })
}
//发货记录
export function GetDeliveryRecord(path) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetDeliveryRecord" + path,
    })
}
//获取供应商订单列表
export function GetOrderList(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetOrderList",
        data,
    })
}
//获取订单详情
export function GetOrderDetail(path) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetOrderDetail" + path,
    })
}
//获取供应出库单
export function GetSupplierStockOutList(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetSupplierStockOutList",
        data,
    })
}
//获取订单退货详情
export function GetOrderDetailEx(path) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetOrderDetailEx" + path,
    })
}
//供应发货详情
export function ScanOrderInfo(path) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "ScanOrderInfo" + path,
    })
}
//供应保存发货
export function SendOrderOut(data) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "SendOrderOut",
        data,
    })
}
//获取订单的发货记录
export function GetOrderOutLog(path) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetOrderOutLog" + path,
    })
}
//获取出库单详情
export function GetSupplierStockOut(path) {
    return http.post({
        url: getBaseUrls().baseUrlSupplier + serviceName + "GetSupplierStockOut" + path,
    })
}
